netbsd_atarittfandomcom-20200214-history
Cross-building a Customized Install
This step is optional. You can always install the OS from the official distribution, however doing a cross-build will allow you to more quickly build the kernel and optimize both kernel / userland as you'd like. I use this for my own reference when installing NetBSD/atari, so the instructions here are fairly pedantic. Initial Setup # Get set up with a NetBSD install on a reasonably fast machine. I've found VMWare Player to work well. The instructions below reflect this choice. # Download the latest NetBSD ISO locally, ex: ftp://ftp.netbsd.org/pub/NetBSD/iso/release version/i386cd-N.N.N.iso. # Create a VM with the following settings: 256MB RAM, as many processors as are available locally, 16GB disk, bridged network connection (no need to select "replicate physical network connection state"), disable sound card. Set the install CD to the downloaded ISO file. # Allow the machine to boot. # Select language, keyboard type. # Pick the option from the utility menu to set up the network. You won't need this for the install itself but the settings will get applied for the OS post-install. # Select the appropriate network options. For me, the defaults work fine. # Go back up to the main menu and select the option to install. # Choose a custom install and add everything except Games and X11. # Select "This is the correct geometry." # Select "Use the entire disk." # Choose to install the NetBSD boot code. # Choose to set the sizes of the partitions. # Change the swap partition size from 128MB to 512MB, then "Accept partitions sizes." # Select "Partition sizes ok." # Select the default disk name. # Choose "Yes" to continue. # Choose "Use BIOS console." # Continue to select the default options and proceed with the install from the virtual CD. # Choose to have the network settings installed to /etc. # Choose the appropriate time zone (US/Pacific works for me). # Choose a password cipher, for example Blowfish 2^7 round. # Set the root password. # Set the root shell to /bin/sh. # Choose the option to restart the system. Disable install mode and/or eject the virtual CD as necessary. # Allow the system to boot and log on as root. # Add a new user for yourself: useradd -m -G wheel username # passwd username # Enable sshd. ## vi /etc/rc.conf ## Add a line: sshd=YES ## Save the file and exit vi. # Enable clock synchronization if you have a non-proxied connection to the Internet. ## vi /etc/rc.conf ## Add: ### ntpdate=YES ### ntpd=YES # Reboot: shutdown -r now Get Ready to Build #When the system comes back, log on remotely via ssh using the username you created. #mkdir syssrc #cd syssrc #If you are behind a web proxy, configure your shell as described in Basic post-install. #ftp ftp://ftp.netbsd.org/pub/NetBSD/version/source/sets/gnusrc.tgz (If you're behind a proxy, a mirror such as ftp2.us.NetBSD.org tends to work better.) #ftp ftp://ftp.netbsd.org/pub/NetBSD/version/source/sets/sharesrc.tgz #ftp ftp://ftp.netbsd.org/pub/NetBSD/version/source/sets/src.tgz #ftp ftp://ftp.netbsd.org/pub/NetBSD/version/source/sets/syssrc.tgz #ftp ftp://ftp.netbsd.org/pub/NetBSD/version/source/sets/xsrc.tgz #su to root #mkdir /usr/src #chown username /usr/src ##Where username is the username created earlier. #mkdir /usr/obj #chown username /usr/obj #vi /etc/mk.conf ##Add the following: .if ${MACHINE} "atari" CPUFLAGS+= -m68030 -m68881 CFLAGS+= -pipe .if ${.CURDIR} != "/usr/src/gnu/lib/libgcc4/libgcc" && ${.CURDIR} != "/usr/src/gnu/lib/libgcc4/libgcc_s" CFLAGS+= -fomit-frame-pointer .endif .endif #Save and exit vi. #vi /etc/inetd.conf #Uncomment the ftp daemon. This will enable you to ftp install the release and kernel that will be built. #/etc/rc.d/inetd restart #Exit out of root. #cd / #progress -zf ~username/syssrc/gnusrc.tgz tar xpf - #progress -zf ~username/syssrc/sharesrc.tgz tar xpf - #progress -zf ~username/syssrc/src.tgz tar xpf - #progress -zf ~username/syssrc/syssrc.tgz tar xpf - #progress -zf ~username/syssrc/xsrc.tgz tar xpf - Build #cd /usr/src/sys/arch/atari/conf #cp ATARITT MYKERNEL #Edit MYKERNEL and Makefile.atari as described in Kernel steps 10 - 12. #cd /usr/src #./build.sh -m atari tools #./build.sh -u -m atari kernel=MYKERNEL #vi /usr/src/etc/etc.atari/Makefile.inc #Remove FALCON, HADES, MILAN-ISAIDE, and MILAN-PCIIDE. #Save and exit vi. #vi /usr/src/share/mk/bsd.lib.mk #Identify the four instances of the -pg flag (type /pg) and remove them. They are incompatible with -fomit-frame-pointer and will otherwise break build.sh. #Save and exit vi. #./build.sh -U -u -x -m atari release Install Now you can ftp install the release from /usr/src/releasedir/atari per the instructions in Basic walkthrough. After that you can ftp the custom kernel you built from /usr/src/sys/arch/atari/compile/obj/MYKERNEL/netbsd.